package spring_annotation.config;

import org.springframework.context.annotation.*;
import org.springframework.context.annotation.ComponentScan.Filter;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;
import spring_annotation.pojo.Person;

@Configuration
@ComponentScans(value = {
        @ComponentScan(value = "spring_annotation", excludeFilters = {
                @Filter(type = FilterType.ANNOTATION, classes = {
                        Controller.class,
                        Service.class
                }),
                @Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {
                        Person.class
                })
        }),
        @ComponentScan(value = "spring_annotation", includeFilters = {
                @Filter(type = FilterType.ANNOTATION, classes = {Repository.class})
        }, useDefaultFilters = false)
})
public class ComponentConfig {

    @Bean(value = "person02")
    public Person person01() {
        return new Person("lisi", 20, "ct");
    }

}
